<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>highlight.jsp</title>
<meta name="generator" content="KF5::SyntaxHighlighting (JSP)"/>
</head><body style="color:#1f1c1b"><pre>
<span style="color:#898887;">&lt;%--</span>
<span style="color:#898887;">  This page won't actually work, as it is simply designed to display jsp syntax highlighting.</span>
<span style="color:#898887;">--%&gt;</span>
<span style="color:#644a9b;font-weight:bold;font-style:italic;">&lt;%@ page</span><span style="color:#006e28;"> info</span>=<span style="color:#bf0303;">&quot;A Page to Test Kate Jsp Syntax Highlighting&quot;</span><span style="color:#006e28;"> language</span>=<span style="color:#bf0303;">&quot;java&quot;</span><span style="color:#006e28;"> errorPage</span>=<span style="color:#bf0303;">&quot;/test-error-page.jsp&quot;</span><span style="color:#644a9b;font-weight:bold;font-style:italic;">%&gt;</span>
<span style="color:#644a9b;font-weight:bold;font-style:italic;">&lt;%@ include</span><span style="color:#006e28;"> file</span>=<span style="color:#bf0303;">&quot;/include/myglobalvars.jsp&quot;</span><span style="color:#644a9b;font-weight:bold;font-style:italic;">%&gt;</span> --%&gt;
<span style="color:#644a9b;font-weight:bold;font-style:italic;">&lt;%@ page</span><span style="color:#006e28;"> import</span>=<span style="color:#bf0303;">&quot;java.util.*,</span>
<span style="color:#bf0303;">                 java.io.*,</span>
<span style="color:#bf0303;">                 java.math.*&quot;</span><span style="color:#006e28;"> </span><span style="color:#644a9b;font-weight:bold;font-style:italic;">%&gt;</span>
<span style="color:#644a9b;font-weight:bold;font-style:italic;">&lt;%@ taglib</span><span style="color:#006e28;"> uri</span>=<span style="color:#bf0303;">&quot;/WEB-INF/lib/si_taglib.tld&quot;</span><span style="color:#006e28;"> prefix</span>=<span style="color:#bf0303;">&quot;si&quot;</span><span style="color:#644a9b;font-weight:bold;font-style:italic;">%&gt;</span>
<span style="color:#644a9b;font-weight:bold;font-style:italic;">&lt;jsp:useBean</span><span style="color:#006e28;"> id</span>=<span style="color:#bf0303;">&quot;aPageBean&quot;</span><span style="color:#006e28;"> scope</span>=<span style="color:#bf0303;">&quot;page&quot;</span><span style="color:#006e28;"> class</span>=<span style="color:#bf0303;">&quot;my.package.MyPageBean&quot;</span><span style="color:#644a9b;font-weight:bold;font-style:italic;">/&gt;</span>
<span style="color:#644a9b;font-weight:bold;font-style:italic;">&lt;jsp:useBean</span><span style="color:#006e28;"> id</span>=<span style="color:#bf0303;">&quot;aRequestBean&quot;</span><span style="color:#006e28;"> scope</span>=<span style="color:#bf0303;">&quot;request&quot;</span><span style="color:#006e28;"> class</span>=<span style="color:#bf0303;">&quot;my.package.MyRequestBean&quot;</span><span style="color:#644a9b;font-weight:bold;font-style:italic;">/&gt;</span>
<span style="color:#006e28;font-weight:bold;">&lt;%</span>
  <span style="color:#898887;">// We can decipher our expected parameters here.</span>
  <span style="color:#644a9b;font-weight:bold;">String</span> parm1 = <span style="color:#644a9b;">noNull</span>(request.<span style="color:#644a9b;">getParameter</span>(PARAMETER_1)).<span style="color:#644a9b;">trim</span>();
  <span style="color:#644a9b;font-weight:bold;">String</span> parm2 = <span style="color:#644a9b;">noNull</span>(request.<span style="color:#644a9b;">getParameter</span>(PARAMETER_2)).<span style="color:#644a9b;">trim</span>();
  <span style="color:#644a9b;font-weight:bold;">String</span> parm3 = <span style="color:#644a9b;">noNull</span>(request.<span style="color:#644a9b;">getParameter</span>(PARAMETER_3)).<span style="color:#644a9b;">trim</span>();
  <span style="color:#644a9b;font-weight:bold;">String</span> parm4 = <span style="color:#644a9b;">noNull</span>(request.<span style="color:#644a9b;">getParameter</span>(PARAMETER_4)).<span style="color:#644a9b;">trim</span>();
  <span style="color:#644a9b;font-weight:bold;">String</span> parm5 = <span style="color:#644a9b;">noNull</span>(request.<span style="color:#644a9b;">getParameter</span>(PARAMETER_5)).<span style="color:#644a9b;">trim</span>();

  <span style="color:#898887;">// A sample collection of Integers to display some code folding.</span>
  <span style="color:#644a9b;font-weight:bold;">List</span> intList = <span style="color:#644a9b;">getIntList</span>(<span style="color:#b08000;">10</span>);


<span style="color:#006e28;font-weight:bold;">%&gt;</span>
&lt;html&gt;
  &lt;title&gt;A Sample Jsp&lt;/title&gt;
  &lt;head&gt;
  &lt;script language=<span style="color:#0057ae;">&quot;javascript&quot;</span>&gt;&lt;!--
    <span style="font-weight:bold;">function</span> <span style="color:#0057ae;">doAlert1</span>() {
      <span style="color:#0057ae;">alert</span>(<span style="color:#bf0303;">&quot;This is the first javascript example.&quot;</span>);
    }

    <span style="font-weight:bold;">function</span> <span style="color:#0057ae;">doAlert2</span>() {
      <span style="color:#0057ae;">alert</span>(<span style="color:#bf0303;">&quot;This is the second javascript example.&quot;</span>);
    }
  <span style="color:#898887;">//--&gt;</span>&lt;/script&gt;
  &lt;style type=<span style="color:#0057ae;">&quot;text/css&quot;</span>&gt;
    body{ <span style="font-weight:bold;">color</span>: <span style="color:#aa5500;">yellow</span>; }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
    <span style="color:#898887;">&lt;%-- The top label table. --%&gt;</span>
    &lt;table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">&quot;400&quot;</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">&quot;0&quot;</span>&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;font<span style="color:#006e28;"> size</span>=<span style="color:#0057ae;">&quot;3&quot;</span>&gt;&lt;b&gt;The following parameters were detected:&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;

    <span style="color:#898887;">&lt;%-- Display the parameters which might have been passed in. --%&gt;</span>
    &lt;table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">&quot;400&quot;</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">&quot;0&quot;</span>&gt;
      <span style="color:#898887;">&lt;%-- Label; Actual Parameter String; Value Detected --%&gt;</span>
      &lt;tr&gt;
        &lt;td&gt;&lt;b&gt;PARAMETER_1&lt;/b&gt;&lt;/td&gt;
        &lt;td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">&quot;center&quot;</span>&gt;<span style="color:#006e28;font-weight:bold;">&lt;%=</span>PARAMETER_1<span style="color:#006e28;font-weight:bold;">%&gt;</span>&lt;/td&gt;
        &lt;td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">&quot;right&quot;</span>&gt;&amp;quot;<span style="color:#006e28;font-weight:bold;">&lt;%=</span>parm1<span style="color:#006e28;font-weight:bold;">%&gt;</span>&amp;quot;&lt;/td&gt;
      &lt;/tr&gt;

      <span style="color:#898887;">&lt;%-- Label; Actual Parameter String; Value Detected --%&gt;</span>
      &lt;tr&gt;
        &lt;td&gt;&lt;b&gt;PARAMETER_2&lt;/b&gt;&lt;/td&gt;
        &lt;td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">&quot;center&quot;</span>&gt;<span style="color:#006e28;font-weight:bold;">&lt;%=</span>PARAMETER_2<span style="color:#006e28;font-weight:bold;">%&gt;</span>&lt;/td&gt;
        &lt;td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">&quot;right&quot;</span>&gt;&amp;quot;<span style="color:#006e28;font-weight:bold;">&lt;%=</span>parm2<span style="color:#006e28;font-weight:bold;">%&gt;</span>&amp;quot;&lt;/td&gt;
      &lt;/tr&gt;

      <span style="color:#898887;">&lt;%-- Label; Actual Parameter String; Value Detected --%&gt;</span>
      &lt;tr&gt;
        &lt;td&gt;&lt;b&gt;PARAMETER_3&lt;/b&gt;&lt;/td&gt;
        &lt;td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">&quot;center&quot;</span>&gt;<span style="color:#006e28;font-weight:bold;">&lt;%=</span>PARAMETER_3<span style="color:#006e28;font-weight:bold;">%&gt;</span>&lt;/td&gt;
        &lt;td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">&quot;right&quot;</span>&gt;&amp;quot;<span style="color:#006e28;font-weight:bold;">&lt;%=</span>parm3<span style="color:#006e28;font-weight:bold;">%&gt;</span>&amp;quot;&lt;/td&gt;
      &lt;/tr&gt;

      <span style="color:#898887;">&lt;%-- Label; Actual Parameter String; Value Detected --%&gt;</span>
      &lt;tr&gt;
        &lt;td&gt;&lt;b&gt;PARAMETER_4&lt;/b&gt;&lt;/td&gt;
        &lt;td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">&quot;center&quot;</span>&gt;<span style="color:#006e28;font-weight:bold;">&lt;%=</span>PARAMETER_4<span style="color:#006e28;font-weight:bold;">%&gt;</span>&lt;/td&gt;
        &lt;td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">&quot;right&quot;</span>&gt;&amp;quot;<span style="color:#006e28;font-weight:bold;">&lt;%=</span>parm4<span style="color:#006e28;font-weight:bold;">%&gt;</span>&amp;quot;&lt;/td&gt;
      &lt;/tr&gt;

      <span style="color:#898887;">&lt;%-- Label; Actual Parameter String; Value Detected --%&gt;</span>
      &lt;tr&gt;
        &lt;td&gt;&lt;b&gt;PARAMETER_5&lt;/b&gt;&lt;/td&gt;
        &lt;td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">&quot;center&quot;</span>&gt;<span style="color:#006e28;font-weight:bold;">&lt;%=</span>PARAMETER_5<span style="color:#006e28;font-weight:bold;">%&gt;</span>&lt;/td&gt;
        &lt;td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">&quot;right&quot;</span>&gt;&amp;quot;<span style="color:#006e28;font-weight:bold;">&lt;%=</span>parm5<span style="color:#006e28;font-weight:bold;">%&gt;</span>&amp;quot;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;

    &lt;br&gt;&lt;br&gt;

    <span style="color:#898887;">&lt;%-- Display our list of random Integers (shows code folding). --%&gt;</span>
    &lt;table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">&quot;400&quot;</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">&quot;0&quot;</span>&gt;
<span style="color:#006e28;font-weight:bold;">&lt;%</span>
  <span style="font-weight:bold;">if</span> (intList != <span style="font-weight:bold;">null</span> &amp;&amp; intList.<span style="color:#644a9b;">size</span>() &gt; <span style="color:#b08000;">0</span>) {
<span style="color:#006e28;font-weight:bold;">%&gt;</span>
      &lt;tr&gt;&lt;td&gt;&lt;b&gt;Here are the elements of intList...&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
<span style="color:#006e28;font-weight:bold;">&lt;%</span>
    <span style="color:#644a9b;font-weight:bold;">Iterator</span> intListIt = intList.<span style="color:#644a9b;">iterator</span>();
    <span style="font-weight:bold;">while</span> (intListIt.<span style="color:#644a9b;">hasNext</span>()) {
      <span style="color:#644a9b;font-weight:bold;">Integer</span> i = (<span style="color:#644a9b;font-weight:bold;">Integer</span>) intListIt.<span style="color:#644a9b;">next</span>();
<span style="color:#006e28;font-weight:bold;">%&gt;</span>
      &lt;tr&gt;&lt;td&gt;<span style="color:#006e28;font-weight:bold;">&lt;%=</span>i.<span style="color:#644a9b;">toString</span>()<span style="color:#006e28;font-weight:bold;">%&gt;</span>&lt;/td&gt;&lt;/tr&gt;
<span style="color:#006e28;font-weight:bold;">&lt;%</span>
    }
  } <span style="font-weight:bold;">else</span> {
<span style="color:#006e28;font-weight:bold;">%&gt;</span>
      &lt;tr&gt;&lt;td&gt;&lt;font<span style="color:#006e28;"> color</span>=<span style="color:#0057ae;">&quot;blue&quot;</span>&gt;&lt;b&gt;&lt;i&gt;Oooops, we forgot to initialize intList!&lt;/i&gt;&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
<span style="color:#006e28;font-weight:bold;">&lt;%</span>
  }
<span style="color:#006e28;font-weight:bold;">%&gt;</span>
    &lt;/table&gt;

    &lt;br&gt;&lt;br&gt;

    <span style="color:#898887;">&lt;%-- We can call javascript functions. --%&gt;</span>
    &lt;table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">&quot;400&quot;</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">&quot;0&quot;</span>&gt;
      &lt;tr&gt;&lt;td<span style="color:#006e28;"> colspan</span>=<span style="color:#0057ae;">&quot;2&quot;</span>&gt;&lt;b&gt;Test our javascript...&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;input<span style="color:#006e28;"> type</span>=<span style="color:#0057ae;">&quot;button&quot;</span><span style="color:#006e28;"> name</span>=<span style="color:#0057ae;">&quot;button1&quot;</span><span style="color:#006e28;"> value</span>=<span style="color:#0057ae;">&quot;Alert 1&quot;</span><span style="color:#006e28;"> onmouseup</span>=<span style="color:#0057ae;">&quot;javascript:doAlert1()&quot;</span>&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input<span style="color:#006e28;"> type</span>=<span style="color:#0057ae;">&quot;button&quot;</span><span style="color:#006e28;"> name</span>=<span style="color:#0057ae;">&quot;button2&quot;</span><span style="color:#006e28;"> value</span>=<span style="color:#0057ae;">&quot;Alert 2&quot;</span><span style="color:#006e28;"> onmouseup</span>=<span style="color:#0057ae;">&quot;javascript:doAlert2()&quot;</span>&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;

    &lt;br&gt;&lt;br&gt;
    <span style="color:#898887;">&lt;%-- If we actually had defined a tag library. --%&gt;</span>
    &lt;table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">&quot;400&quot;</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">&quot;0&quot;</span>&gt;
      &lt;tr&gt;&lt;td&gt;
      <span style="font-weight:bold;">&lt;my:SampleTag</span><span style="color:#006e28;"> prop1</span>=<span style="color:#0057ae;">&quot;first&quot;</span><span style="color:#006e28;"> prop2</span>=<span style="color:#0057ae;">&quot;third&quot;</span><span style="font-weight:bold;">&gt;</span>
        <span style="font-weight:bold;">&lt;my:SampleTagChild</span><span style="color:#006e28;"> nameProp</span>=<span style="color:#0057ae;">&quot;value1&quot;</span><span style="font-weight:bold;">/&gt;</span>
        <span style="font-weight:bold;">&lt;my:SampleTagChild</span><span style="color:#006e28;"> nameProp</span>=<span style="color:#0057ae;">&quot;value2&quot;</span><span style="font-weight:bold;">/&gt;</span>
      <span style="font-weight:bold;">&lt;/my:SampleTag&gt;</span>
      &lt;/td&gt;&lt;/tr&gt;
    &lt;/table&gt;

    &lt;br&gt;&lt;br&gt;
    <span style="color:#898887;">&lt;%-- Expression language. --%&gt;</span>
    &lt;table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">&quot;400&quot;</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">&quot;0&quot;</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">&quot;0&quot;</span>&gt;
      <span style="font-weight:bold;">&lt;c:if</span><span style="color:#006e28;"> test</span>=<span style="color:#0057ae;">&quot;</span><span style="color:#006e28;font-weight:bold;">${</span>!<span style="font-weight:bold;">empty</span> param.<span style="color:#644a9b;">aParam</span><span style="color:#006e28;font-weight:bold;">}</span><span style="color:#0057ae;">&quot;</span><span style="font-weight:bold;">&gt;</span>
        <span style="font-weight:bold;">&lt;c:set</span><span style="color:#006e28;"> var</span>=<span style="color:#0057ae;">&quot;myParam&quot;</span><span style="color:#006e28;"> scope</span>=<span style="color:#0057ae;">&quot;session&quot;</span><span style="color:#006e28;"> value</span>=<span style="color:#0057ae;">&quot;</span><span style="color:#006e28;font-weight:bold;">${</span>param.<span style="color:#644a9b;">aParam</span><span style="color:#006e28;font-weight:bold;">}</span><span style="color:#0057ae;">&quot;</span><span style="font-weight:bold;">/&gt;</span>
      <span style="font-weight:bold;">&lt;/c:if&gt;</span>

      &lt;tr&gt;&lt;td&gt;myParam's value: &amp;quot;<span style="font-weight:bold;">&lt;c:out</span><span style="color:#006e28;"> value</span>=<span style="color:#0057ae;">&quot;</span><span style="color:#006e28;font-weight:bold;">${</span>myParam<span style="color:#006e28;font-weight:bold;">}</span><span style="color:#0057ae;">&quot;</span><span style="color:#006e28;"> default</span>==<span style="color:#0057ae;">&quot;Default&quot;</span><span style="font-weight:bold;">/&gt;</span>&amp;quot;&lt;/td&gt;&lt;/tr&gt;
    &lt;/table&gt;
  &lt;/body&gt;
&lt;/html&gt;
<span style="color:#006e28;font-weight:bold;">&lt;%!</span>
  <span style="color:#898887;">/* A place for class variables and functions... */</span>

  <span style="color:#898887;">// Define some sample parameter names that this page might understand.</span>
  <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#644a9b;font-weight:bold;">String</span> PARAMETER_1            = <span style="color:#bf0303;">&quot;p1&quot;</span>;
  <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#644a9b;font-weight:bold;">String</span> PARAMETER_2            = <span style="color:#bf0303;">&quot;p2&quot;</span>;
  <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#644a9b;font-weight:bold;">String</span> PARAMETER_3            = <span style="color:#bf0303;">&quot;p3&quot;</span>;
  <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#644a9b;font-weight:bold;">String</span> PARAMETER_4            = <span style="color:#bf0303;">&quot;p4&quot;</span>;
  <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#644a9b;font-weight:bold;">String</span> PARAMETER_5            = <span style="color:#bf0303;">&quot;p5&quot;</span>;

  <span style="color:#898887;">// Returns str trimmed, or an empty string if str is null.</span>
  <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#644a9b;font-weight:bold;">String</span> <span style="color:#644a9b;">noNull</span>(<span style="color:#644a9b;font-weight:bold;">String</span> str) {
    <span style="color:#644a9b;font-weight:bold;">String</span> retStr;
    <span style="font-weight:bold;">if</span> (str == <span style="font-weight:bold;">null</span>)
      retStr = <span style="color:#bf0303;">&quot;&quot;</span>;
    <span style="font-weight:bold;">else</span>
      retStr = str.<span style="color:#644a9b;">trim</span>();

    <span style="font-weight:bold;">return</span> retStr;
  }

  <span style="color:#898887;">// Returns a list of Integers with listSize elements.</span>
  <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#644a9b;font-weight:bold;">List</span> <span style="color:#644a9b;">getIntList</span>(<span style="color:#0057ae;">int</span> listSize) {
    <span style="color:#644a9b;font-weight:bold;">ArrayList</span> retList = <span style="font-weight:bold;">new</span> <span style="color:#644a9b;font-weight:bold;">ArrayList</span>(listSize);
    <span style="font-weight:bold;">for</span> (<span style="color:#0057ae;">int</span> i = <span style="color:#b08000;">0</span>; i &lt; listSize; i++)
      retList.<span style="color:#644a9b;">add</span>(<span style="font-weight:bold;">new</span> <span style="color:#644a9b;font-weight:bold;">Integer</span>( (<span style="color:#0057ae;">int</span>) (<span style="color:#644a9b;font-weight:bold;">Math</span>.<span style="color:#644a9b;">random</span>() * <span style="color:#b08000;">100</span>) ));

    <span style="font-weight:bold;">return</span> retList;
  }
<span style="color:#006e28;font-weight:bold;">%&gt;</span>
</pre></body></html>
